<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<jsp:include page="../common/header.jsp"></jsp:include>
<link rel="stylesheet" href="css/data.css">
<body onload="disptime()">
 <div class="Top">
  <p class="ChineseName">大气环境微型监测系统（环境物联网）</p>
  <p class="EnglishName">Micromonitoring System for Atmospheric Environment</p>
  </div>
				<table id="t_button">
					<thead>
						<tr>
							<th class="t_time1">时间</th>
							<th>SO2 (μg/m³)</th>
							<th>NO2 (μg/m³)</th>
							<th>CO (mg/m³)</th>
							<th>O3 (μg/m³)</th>
							<th>PM2.5 (μg/m³)</th>
							<th>PM10 (μg/m³)</th>
							<th>温度(℃)</th>
							<th>湿度 (%RH)</th>
							<th>风速(m/s)</th>
							<th>压强(hPa)</th>
							<th>雨量(mm)</th>
							<th class="thright">风向</th>
						</tr>
					</thead>
					<tbody>
						<c:forEach items="${weather }" var="weather" begin="${weather.size()>=8?weather.size()-8:0}" varStatus="status">
							
							<tr <c:if test="${status.count%2==0}">bgcolor="#F5F5F5"</c:if><c:if test="${status.count%2==1}">bgcolor="#FFFFFF"</c:if>>
								<td class="t_time">${weather.Time }</td>
								<c:choose>
								    <c:when test="${weather.SO2<0}">
								    <td style="color:rgb(255,0,0)">${weather.SO2 }</td>
								    </c:when>
								    <c:when test="${weather.SO2>=0}">
								    <td>${weather.SO2 }</td>
								    </c:when>
								</c:choose>
								<c:choose>
								    <c:when test="${weather.NO2<0}">
								    <td style="color:rgb(255,0,0)">${weather.NO2 }</td>
								    </c:when>
								    <c:when test="${weather.NO2>=0}">
								    <td>${weather.NO2 }</td>
								    </c:when>
								</c:choose>
								<c:choose>
								    <c:when test="${weather.CO<0}">
								    <td style="color:rgb(255,0,0)">${weather.CO }</td>
								    </c:when>
								    <c:when test="${weather.CO>=0}">
								    <td>${weather.CO }</td>
								    </c:when>
								</c:choose>
								<c:choose>
								    <c:when test="${weather.O3<0}">
								    <td style="color:rgb(255,0,0)">${weather.O3 }</td>
								    </c:when>
								    <c:when test="${weather.O3>=0}">
								    <td>${weather.O3 }</td>
								    </c:when>
								</c:choose>
								<c:choose>
								    <c:when test="${weather.PM25<0}">
								    <td style="color:rgb(255,0,0)">${weather.PM25 }</td>
								    </c:when>
								    <c:when test="${weather.PM25>=0}">
								    <td>${weather.PM25 }</td>
								    </c:when>
								</c:choose>
								<c:choose>
								    <c:when test="${weather.PM10<0}">
								    <td style="color:rgb(255,0,0)">${weather.PM10 }</td>
								    </c:when>
								    <c:when test="${weather.PM10>=0}">
								    <td>${weather.PM10 }</td>
								    </c:when>
								</c:choose>
								<c:choose>
								    <c:when test="${weather.Temper<0}">
								    <td style="color:rgb(255,0,0)">${weather.Temper }</td>
								    </c:when>
								    <c:when test="${weather.Temper>=0}">
								    <td>${weather.Temper }</td>
								    </c:when>
								</c:choose>
								<c:choose>
								    <c:when test="${weather.Hum<0}">
								    <td style="color:rgb(255,0,0)">${weather.Hum }</td>
								    </c:when>
								    <c:when test="${weather.Hum>=0}">
								    <td>${weather.Hum }</td>
								    </c:when>
								</c:choose>
								<c:choose>
								    <c:when test="${weather.Speed<0}">
								    <td style="color:rgb(255,0,0)">${weather.Speed }</td>
								    </c:when>
								    <c:when test="${weather.Speed>=0}">
								    <td>${weather.Speed }</td>
								    </c:when>
								</c:choose>
								<c:choose>
								    <c:when test="${weather.Press<0}">
								    <td style="color:rgb(255,0,0)">${weather.Press }</td>
								    </c:when>
								    <c:when test="${weather.Press>=0}">
								    <td>${weather.Press }</td>
								    </c:when>
								</c:choose>
								<c:choose>
								    <c:when test="${weather.Rainfall<0}">
								    <td style="color:rgb(255,0,0)">${weather.Rainfall }</td>
								    </c:when>
								    <c:when test="${weather.Rainfall>=0}">
								    <td>${weather.Rainfall }</td>
								    </c:when>
								</c:choose>
								<td class="Direct">${weather.Direct}</td>
							</tr>

						</c:forEach>
					</tbody>
				</table>
				<div class="Button" style="position: absolute;top:630px;right:350px;"><a class="ButtonName" href="weather/Refresh" style="position: absolute;left:30px">刷新数据</a></div>
                <div class="Button" style="position: absolute;top:630px;right:100px;"><a class="ButtonName" href="weather/GetData" style="position: absolute;left:30px">获取数据</a></div>
				<div class="Bottom">
    				<p class="CopyRight" >Copyriht © 西南科技大学物联网与智能信息处理科研团队（SWUST-IOTIIP） All Rights Reserved.</p>
 				</div>
 				<script> 
					function disptime(){
					var d = new Date();  
            		document.getElementById("myclock").innerHTML=d.getFullYear() + "年" +(d.getMonth() + 1) + "月" + d.getDate() + "日"+" "+d.getHours()+":"+d.getMinutes()+":"+d.getSeconds();
            		var myTime=setTimeout("disptime()",1000);
            		}
    			</script>
				<div class="EnglishName" id="myclock"
						style="position: absolute; right: 100px; top: 35px;"></div>
				<img
						style="position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; z-Index: -1;"
						src="image/background.jpg" />
</body>
</html>
